<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dubbo 监控中心架构解析</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .text-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .drop-cap::first-letter {
            float: left;
            font-size: 4rem;
            line-height: 3rem;
            padding-right: 0.5rem;
            margin-top: 0.5rem;
            font-weight: 700;
            color: #667eea;
        }
        .section-divider {
            position: relative;
            text-align: center;
            margin: 3rem 0;
        }
        .section-divider::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(to right, transparent, #e5e7eb, transparent);
        }
        .section-divider span {
            background: white;
            padding: 0 2rem;
            position: relative;
            font-weight: 500;
            color: #6b7280;
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        .icon-box {
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-size: 24px;
            margin-bottom: 1rem;
        }
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .animate-fadeInUp {
            animation: fadeInUp 0.8s ease-out;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto text-center animate-fadeInUp">
            <h1 class="text-5xl md:text-6xl font-bold mb-6">
                <i class="fas fa-network-wired mr-4"></i>Dubbo 监控中心
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">深入理解分布式服务架构中的监控机制</p>
            <div class="flex justify-center space-x-4">
                <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                    <i class="fas fa-chart-line mr-2"></i>性能监控
                </span>
                <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                    <i class="fas fa-shield-alt mr-2"></i>高可用架构
                </span>
                <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                    <i class="fas fa-cogs mr-2"></i>服务治理
                </span>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="max-w-6xl mx-auto px-6 py-12">
        <!-- Introduction -->
        <section class="mb-16">
            <div class="bg-white rounded-2xl shadow-lg p-8 card-hover">
                <p class="text-lg leading-relaxed text-gray-700 drop-cap">
                    在 Dubbo 中，监控中心（Monitor）主要用于收集和统计服务调用的日志、性能指标和异常信息，以便进行系统监控和分析。然而，监控中心的存在并不直接影响生产者（服务提供者）和消费者（服务消费者）之间的通信。
                </p>
            </div>
        </section>

        <!-- Architecture Diagram -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold text-center mb-8 text-gradient">Dubbo 架构全景图</h2>
            <div class="bg-white rounded-2xl shadow-lg p-8">
                <div class="mermaid">
                    graph TB
                        subgraph "服务治理层"
                            A[注册中心<br/>Registry]
                            B[监控中心<br/>Monitor]
                        end
                        
                        subgraph "服务层"
                            C[服务提供者<br/>Provider]
                            D[服务消费者<br/>Consumer]
                        end
                        
                        C -->|1.注册服务| A
                        D -->|2.订阅服务| A
                        A -->|3.通知| D
                        D -->|4.调用| C
                        C -->|5.统计| B
                        D -->|5.统计| B
                        
                        style A fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                        style B fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                        style C fill:#4ade80,stroke:#fff,stroke-width:2px,color:#fff
                        style D fill:#60a5fa,stroke:#fff,stroke-width:2px,color:#fff
                </div>
            </div>
        </section>

        <!-- Monitor Functions -->
        <section class="mb-16">
            <div class="section-divider">
                <span><i class="fas fa-star mr-2"></i>核心功能</span>
            </div>
            
            <h2 class="text-3xl font-bold text-center mb-12">监控中心的作用</h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-2xl shadow-lg p-8 card-hover">
                    <div class="icon-box">
                        <i class="fas fa-database"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4 text-gray-800">收集数据</h3>
                    <p class="text-gray-600 leading-relaxed mb-4">
                        记录服务调用的次数、耗时、成功率、异常情况等信息。
                    </p>
                    <ul class="space-y-2 text-gray-600">
                        <li><i class="fas fa-check-circle text-green-500 mr-2"></i>调用次数统计</li>
                        <li><i class="fas fa-check-circle text-green-500 mr-2"></i>响应时间分析</li>
                        <li><i class="fas fa-check-circle text-green-500 mr-2"></i>异常率监控</li>
                        <li><i class="fas fa-check-circle text-green-500 mr-2"></i>服务依赖关系</li>
                    </ul>
                </div>
                
                <div class="bg-white rounded-2xl shadow-lg p-8 card-hover">
                    <div class="icon-box">
                        <i class="fas fa-chart-pie"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4 text-gray-800">分析和展示</h3>
                    <p class="text-gray-600 leading-relaxed mb-4">
                        为运维人员提供系统运行状态的分析和展示。
                    </p>
                    <ul class="space-y-2 text-gray-600">
                        <li><i class="fas fa-check-circle text-purple-500 mr-2"></i>实时监控大屏</li>
                        <li><i class="fas fa-check-circle text-purple-500 mr-2"></i>性能趋势图表</li>
                        <li><i class="fas fa-check-circle text-purple-500 mr-2"></i>告警通知机制</li>
                        <li><i class="fas fa-check-circle text-purple-500 mr-2"></i>服务健康报告</li>
                    </ul>
                </div>
            </div>
        </section>

        <!-- Impact Analysis -->
        <section class="mb-16">
            <div class="section-divider">
                <span><i class="fas fa-exclamation-triangle mr-2"></i>影响分析</span>
            </div>
            
            <h2 class="text-3xl font-bold text-center mb-12">监控中心挂了对通信的影响</h2>
            
            <div class="bg-gradient-to-r from-purple-50 to-indigo-50 rounded-2xl p-8 mb-8">
                <p class="text-lg text-center text-gray-700 font-medium">
                    <i class="fas fa-info-circle text-indigo-600 mr-2"></i>
                    当监控中心挂掉后，Dubbo 的生产者和消费者之间的通信不会受到影响
                </p>
            </div>
            
            <div class="space-y-6">
                <div class="bg-white rounded-2xl shadow-lg p-8 card-hover">
                    <div class="flex items-start">
                        <div class="flex-shrink-0">
                            <div class="w-12 h-12 bg-green-100 rounded-full flex items-center justify-center">
                                <span class="text-green-600 font-bold text-lg">1</span>
                            </div>
                        </div>
                        <div class="ml-6">
                            <h3 class="text-xl font-bold mb-3 text-gray-800">通信不依赖监控中心</h3>
                            <p class="text-gray-600 leading-relaxed">
                                生产者和消费者之间的调用是通过注册中心（如 ZooKeeper）来实现的，而不是通过监控中心。因此，监控中心挂掉不会中断服务的调用。
                            </p>
                        </div>
                    </div>
                </div>
                
                <div class="bg-white rounded-2xl shadow-lg p-8 card-hover">
                    <div class="flex items-start">
                        <div class="flex-shrink-0">
                            <div class="w-12 h-12 bg-yellow-100 rounded-full flex items-center justify-center">
                                <span class="text-yellow-600 font-bold text-lg">2</span>
                            </div>
                        </div>
                        <div class="ml-6">
                            <h3 class="text-xl font-bold mb-3 text-gray-800">监控数据的丢失</h3>
                            <p class="text-gray-600 leading-relaxed">
                                监控中心挂掉后，监控数据无法继续收集。这意味着你将无法获得服务的实时性能指标和调用日志，但这并不会影响服务的正常运行。
                            </p>
                        </div>
                    </div>
                </div>
                
                <div class="bg-white rounded-2xl shadow-lg p-8 card-hover">
                    <div class="flex items-start">
                        <div class="flex-shrink-0">
                            <div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center">
                                <span class="text-blue-600 font-bold text-lg">3</span>
                            </div>
                        </div>
                        <div class="ml-6">
                            <h3 class="text-xl font-bold mb-3 text-gray-800">监控信息缓冲</h3>
                            <p class="text-gray-600 leading-relaxed">
                                在监控中心恢复后，Dubbo 会尝试重新连接并上报暂时存储的监控数据（如果有缓冲机制）。但在监控中心挂掉期间产生的数据可能会丢失。
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Best Practices -->
        <section class="mb-16">
            <div class="section-divider">
                <span><i class="fas fa-lightbulb mr-2"></i>最佳实践</span>
            </div>
            
            <h2 class="text-3xl font-bold text-center mb-12">监控中心高可用方案</h2>
            
            <div class="grid md:grid-cols-3 gap-6">
                <div class="bg-white rounded-xl shadow-md p-6 text-center card-hover">
                    <i class="fas fa-server text-4xl text-indigo-600 mb-4"></i>
                    <h4 class="font-bold text-lg mb-2">集群部署</h4>
                    <p class="text-gray-600 text-sm">部署多个监控中心实例，实现负载均衡和故障转移</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 text-center card-hover">
                    <i class="fas fa-hdd text-4xl text-purple-600 mb-4"></i>